<div id="main">
    <div id="contents">
        <form method="post" name="autoform">
            <div class="frame_tab_layer" style="padding-left:25px;padding-top:5px;">
                <table class="cmenutitle" cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tbody>
                    <tr>
                        <td id="linetype" class="frame_tab_line" colspan="2"> </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <fieldset>
                <legend id="linetype_title">LINE</legend>
                <div class="frame_tab_layer">
                    <table class="cmenutitle" cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tbody>
                        <tr>
                            <td class="frame_tab_left">
                                <span id="img401" class="errormsg">&nbsp;</span>
                                <label for="id401">
                                    <label sid="extension.phone"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id401" type="text" name="id401">
                            </td>
                        </tr>
                        <tr>
                            <td class="frame_tab_left">
                                <label for="id584">
                                    <label sid="extension.call_barring"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <select id="id584" name="id584">
                                    <option value="0" sid="extension.intercon"></option>
                                    <option value="1" sid="extension.local"></option>
                                    <option value="2" sid="extension.domestic"></option>
                                    <option value="3" sid="extension.Int"></option>
                                    <option value="on" sid="extension.None"></option>
                                </select>
                            </td>
                        </tr>
                        <tr id="tr366">
                            <td class="frame_tab_left">
                                <label for="id366">
                                    <label sid="extension.call_forwarding"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <select id="id366" onchange="read()" name="id366">
                                    <option value="0" sid="extension.call_fwd_close"></option>
                                    <option value="1" sid="extension.fwd_call_to_another"></option>
                                    <option value="2" sid="extension.fwd_unanswered_to_another"></option>
                                  <!--  <option value="3" sid="extension.fwd_to_voicemail"></option>
                                    <option value="4" sid="extension.fwd_unanswered_to_voicemail"></option>-->
                                </select>
                            </td>
                        </tr>
                        <tr id="tr367">
                            <td class="frame_tab_left">
                                <span id="img367" class="errormsg">&nbsp;</span>
                                <label for="id367">
                                    <label sid="extension.fwd_number"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id367" type="text" name="id367">
                            </td>
                        </tr>
                       <!-- <tr id="td594">
                            <td class="frame_tab_left">
                                <label for="id594">
                                    <label sid="extension.permanent_recording"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id594" type="checkbox" name="id594">
                            </td>
                        </tr>  -->
                        </tbody>
                    </table>
                </div>
            </fieldset>
            <div class="submitFooter">
                <input sid="sbutton.save" class = "button" type ="button" name = "submit"/>
                <input sid="menu.adv_cfg" class = "button" type ="button" id="super_button" name = "extension_stat"/>
            </div>
        </form>
    </div>
</div>
<br>
<div id="helpContainer">
    <div id="help">
        <div>
            <h2>
                <label sid="share.help"></label>
            </h2>
        </div>
        <div id="helpBody">
            <dl>
                <dt class="term">
                    <label sid="ivr_menu.extension"></label>
                </dt>
                <dd class="definition">
                    <label sid="desktopphones.desc"></label>
                </dd>

                <dt class="term">
                    <label sid="desktopphones.sp1_2"></label>
                </dt>
                <dd class="definition">
                    <label sid="desktopphones.sp1_2_setp1"></label><br>
                    <label sid="desktopphones.sp1_2_setp2"></label><br><br>
                    <label sid="desktopphones.sp1_2_setp3"></label><br>
                    <label sid="desktopphones.sp1_2_setp4"></label><br><br>
                    <label sid="desktopphones.sp1_2_setp5"></label><br>
                    <label sid="desktopphones.sp1_2_setp6"></label><br><br>
                    <label sid="desktopphones.sp1_2_setp7"></label><br>
                    <label sid="desktopphones.sp1_2_setp8"></label><br><br>
                    <label sid="desktopphones.sp1_2_setp9"></label><br>
                    <label sid="desktopphones.sp1_2_setp10"></label>
                </dd>
                <dt class="term">
                    <label sid="desktopphones.sp1_3"></label>
                </dt>
                <dd class="definition">
                    <label sid="desktopphones.sp1_3_setp1"></label><br>
                    <label sid="desktopphones.sp1_3_setp2"></label><br><br>
                    <label sid="desktopphones.sp1_3_setp3"></label><br>
                    <label sid="desktopphones.sp1_3_setp4"></label><br><br>
                    <label sid="desktopphones.sp1_3_setp5"></label><br>
                    <label sid="desktopphones.sp1_3_setp6"></label>
                </dd>
            </dl>

        </div>
    </div>
</div>
<script type="text/javascript" src="js/getSelectList.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
        var sendtext = "&id=4000";
        getSelectList(sendtext);
        read();

        $("[name=submit]").click(function () {
            $(".errormsg").html('');
            var nonames = new Array("line","submit","extension_batch","extension_stat","add_extension","ip_extension_batch","ip_extension_stat","id366","id584");
            var settext = "&line_id="+getCookie("line_id");
            settext += getSetText(nonames);
            var id366_val = $("[name=id366]").val();
            var id584_val = $("[name=id584]").val();
            if(id366_val=="0") {
                settext+="&id366=0&id600=0";
            }else if(id366_val=="1") {
                settext+="&id366=1&id600=0";
            }else if(id366_val=="2") {
                settext+="&id366=2&id600=0";
            }else if(id366_val=="3") {
                settext+="&id366=0&id600=1";
            }else if(id366_val=="4") {
                settext+="&id366=0&id600=2";
            }
            if(id584_val=="on") {
                settext+="&id447="+id584_val;
            }else {
                settext+="&id584="+id584_val+"&id447=off";
            }
            settext=settext.replace(/\#/g,"%23");
            submitform(modules["set_data"],settext);
        });

        $("#super_button").bind("click",function(){
            loadNewHtml("extension_more.htm");
    });
    });


    function read() {
	if($("[name=id366]").val()=='0') {
		$("#tr367").hide();
	}else {
		$("#tr367").show();
	}
}
</script>

